import { Component } from 'react'

import{ num } from '../api/index'
import{ NavLink,Switch,Route } from 'react-router-dom'
import '../css/home.css';

// 路由引入
import Work from '../components/Work';
import Client from '../components/Client';
import Project from '../components/Project';
import Business from '../components/Business';

export default class extends Component {

    componentDidMount(){
        this.getNum()
    }

    async getNum(){
        const res = await num()
        console.log(res)
    }

    render(){
        return (
            <>
                 <div className="m-nav">
                     <div className="m-nav_l">
                         <div className='m-nav-logo'>
                             <img src="http://crm.cimns.com/static/img/logo.3e34073.png" alt=""/>
                         </div>
                         <ul className='m-nav-list'>
                             <NavLink exact to="/">
                                 <li>
                                     <i className='iconfont icon-changyongicon-'></i>
                                     <p>办公</p>
                                 </li>
                             </NavLink>
                            <NavLink to="/Client">
                                 <li>
                                     <i className='iconfont icon-kehu'></i>
                                     <p>客户管理</p>
                                 </li>
                            </NavLink>
                             <NavLink to="/Business">
                                 <li>
                                     <i className='iconfont icon-zhuzhuangtu'></i>
                                     <p>商业智能</p>
                                 </li>
                             </NavLink>
                             <NavLink to="/Project">
                                 <li>
                                     <i className='iconfont icon-wenjianguanli'></i>
                                     <p>项目管理</p>
                                 </li>
                             </NavLink>
                         </ul>
                     </div>
                     <div className="m-nav_r">
                         <div className='m-tq'>
                             开通特权
                             <div className="m-txt">
                             <p className="m-text1">您暂未开通授权</p>
                             <p className="m-text2">为了给您提供更好的服务支持建议您购买官方授权</p>
                                 <div className="m-tel">
                                     <span>400-0812-558</span>
                                 </div>
                             </div>
                         </div>
                         <div className="m-home">
                             <div className='m-names'>
                                 <img src="http://crm.cimns.com/public/uploads/20210427/thumb_9a3e8baa46f43f086f3ae8953bf10148.png" alt=""/>
                             </div>
                             <i className='iconfont icon'>&#xe631;</i>
                         </div>
                     </div>
                 </div>
                 <div className="content">
                     <Switch>
                         <Route path="/" component={Work} exact/>
                         <Route path="/Client" component={Client}/>
                         <Route path="/Business" component={Business}/>
                         <Route path="/Project" component={Project}/>
                     </Switch>
                 </div>
             </>
         )
    }
}

